home *** CD-ROM | disk | FTP | other *** search
/ Sunday Savers: Sharing Fun! I Know My Savior Lives / Sunday Savers: Sharing Fun! I Know My Savior Lives.iso / mac / Xtras / Buddy API 3.7 / Buddy API Docs.swf / texts / 1692.txt < prev    next >
Encoding:
Text File  |  2004-08-31  |  3.9 KB  |  169 lines

  1. 180
  2. --- RECORDSEPARATOR ---
  3.  
  4. --- RECORDSEPARATOR ---
  5. WaitForWindow 
  6. --- RECORDSEPARATOR ---
  7. Platform:
  8. --- RECORDSEPARATOR ---
  9.  
  10. --- RECORDSEPARATOR ---
  11. Windows and Macintosh
  12. --- RECORDSEPARATOR ---
  13.  
  14. --- RECORDSEPARATOR ---
  15. Description:
  16. --- RECORDSEPARATOR ---
  17.  
  18. --- RECORDSEPARATOR ---
  19. baWaitForWindow waits until a window is in a specified state, with an optional 
  20. --- RECORDSEPARATOR ---
  21. timeout.
  22. --- RECORDSEPARATOR ---
  23.  
  24. --- RECORDSEPARATOR ---
  25. Usage:
  26. --- RECORDSEPARATOR ---
  27.  
  28. --- RECORDSEPARATOR ---
  29. Result = baWaitForWindow( WinHandle, State, TimeOut )
  30. --- RECORDSEPARATOR ---
  31.  
  32. --- RECORDSEPARATOR ---
  33. Arguments:
  34. --- RECORDSEPARATOR ---
  35.  
  36. --- RECORDSEPARATOR ---
  37. Integer, String, Integer 
  38. --- RECORDSEPARATOR ---
  39. WinHandle is the handle of the window to wait for. 
  40. --- RECORDSEPARATOR ---
  41. State is the state to wait for. Can be: 
  42. --- RECORDSEPARATOR ---
  43. "inactive" 
  44. --- RECORDSEPARATOR ---
  45. waits until the window is inactive 
  46. --- RECORDSEPARATOR ---
  47. "active" 
  48. --- RECORDSEPARATOR ---
  49. waits until the window is active 
  50. --- RECORDSEPARATOR ---
  51. "closed" 
  52. --- RECORDSEPARATOR ---
  53. waits until the window is closed 
  54. --- RECORDSEPARATOR ---
  55. TimeOut is the maximum amount of time to wait in ticks. A tick is equal to 1/60th of 
  56. --- RECORDSEPARATOR ---
  57. a second. If TimeOut is 0, the function will wait indefinitely.
  58. --- RECORDSEPARATOR ---
  59.  
  60. --- RECORDSEPARATOR ---
  61. Returns:
  62. --- RECORDSEPARATOR ---
  63.  
  64. --- RECORDSEPARATOR ---
  65. Integer. 
  66. --- RECORDSEPARATOR ---
  67. Returns 0 if the window doesn't exist, or the timeout occurs before the window 
  68. --- RECORDSEPARATOR ---
  69. reaches the specified state. 
  70. --- RECORDSEPARATOR ---
  71. Returns 1 if the window reached the specified state.
  72. --- RECORDSEPARATOR ---
  73.  
  74. --- RECORDSEPARATOR ---
  75. Examples:
  76. --- RECORDSEPARATOR ---
  77.  
  78. --- RECORDSEPARATOR ---
  79. Director: 
  80. --- RECORDSEPARATOR ---
  81. set OK = baWaitForWindow( baWinHandle(), "active", 300 ) --
  82. --- RECORDSEPARATOR ---
  83.  waits for the Director 
  84. --- RECORDSEPARATOR ---
  85. window to become active, for a maximum of 5 seconds
  86. --- RECORDSEPARATOR ---
  87.  
  88. --- RECORDSEPARATOR ---
  89. Authorware: 
  90. --- RECORDSEPARATOR ---
  91. OK := baWaitForWindow( 3248, "closed", 600 )
  92. --- RECORDSEPARATOR ---
  93.  -- waits for the window 3248 to be 
  94. --- RECORDSEPARATOR ---
  95. closed, for a maximum of 10 seconds
  96. --- RECORDSEPARATOR ---
  97.  
  98. --- RECORDSEPARATOR ---
  99. Notes:
  100. --- RECORDSEPARATOR ---
  101.  
  102. --- RECORDSEPARATOR ---
  103. The "inactive" option is useful for waiting until the Director/Authorware window is 
  104. --- RECORDSEPARATOR ---
  105. inactive after starting another program. When the Director/Authorware window is 
  106. --- RECORDSEPARATOR ---
  107. no longer active, then the other program has opened and has focus. 
  108. --- RECORDSEPARATOR ---
  109. For example, here is some code to open a readme file in Authorware, and wait until 
  110. --- RECORDSEPARATOR ---
  111. the user has finished with it. 
  112. --- RECORDSEPARATOR ---
  113. if baOpenFile( "readme.txt" , "normal" ) > 32 then 
  114. --- RECORDSEPARATOR ---
  115. --
  116. --- RECORDSEPARATOR ---
  117.  open readme file
  118. --- RECORDSEPARATOR ---
  119.  
  120. --- RECORDSEPARATOR ---
  121. wnd := baNextActiveWindow( 0 ) 
  122. --- RECORDSEPARATOR ---
  123. --
  124. --- RECORDSEPARATOR ---
  125.  get handle of Notepad window
  126. --- RECORDSEPARATOR ---
  127.  
  128. --- RECORDSEPARATOR ---
  129. baWaitForWindow( baWinHandle() , "active" , 0 ) 
  130. --- RECORDSEPARATOR ---
  131. --
  132. --- RECORDSEPARATOR ---
  133.  wait till the Authorware
  134. --- RECORDSEPARATOR ---
  135.  
  136. --- RECORDSEPARATOR ---
  137. --
  138. --- RECORDSEPARATOR ---
  139.  window is active i.e. Notepad has been close 
  140. --- RECORDSEPARATOR ---
  141. -- or user switched back to Authorware
  142. --- RECORDSEPARATOR ---
  143.  
  144. --- RECORDSEPARATOR ---
  145. if baWindowExists( wnd ) 
  146. --- RECORDSEPARATOR ---
  147. then baCloseWindow( wnd ) 
  148. --- RECORDSEPARATOR ---
  149. --
  150. --- RECORDSEPARATOR ---
  151.  close Notepad
  152. --- RECORDSEPARATOR ---
  153.  
  154. --- RECORDSEPARATOR ---
  155. end if 
  156. --- RECORDSEPARATOR ---
  157. end if
  158. --- RECORDSEPARATOR ---
  159.  
  160. --- RECORDSEPARATOR ---
  161. See also:
  162. --- RECORDSEPARATOR ---
  163.  
  164. --- RECORDSEPARATOR ---
  165. baWaitTillActive 
  166. --- RECORDSEPARATOR ---
  167. baNextActiveWindow 
  168. --- RECORDSEPARATOR ---
  169. baActiveWindow